let mongoose = require("mongoose");
mongoose.connect("mongodb://localhost:27017/newQY",{
    useNewUrlParser:true,
    useUnifiedTopology:true
}).then(()=>{
    console.log("头像-数据库连接成功！");
}).catch(()=>{
    console.log("数据库连接失败！");
})
let schema = mongoose.Schema;
let imageList = new schema({
    //图片地址
    src:{
        type:String,
        required:true
    },
    // 上传用户
    users:{
        type:String,
        required:true
    },
    // 上传时间
    createTime:{
        type:String,
        required:true
    },
    // 属性
    type:{
        type:String,
        required:true
    },
    // 图片名称
    name:{
        type:String,
        required:true
    }
})
let images = mongoose.model("imageList",imageList)
module.exports = {
    images
}